Barcodes are widely used to identify and track goods and documents, among other things. A commonly used barcode is a linear barcode, which is a machine-readable representation of data that represents data in the widths and spacing of parallel lines. Different linear barcode formats have emerged over time, with Universal Product Code (UPC) and European Article Number (EAN) being two commonly used barcode formats.
A commonly used UPC code is a UPC-A barcode. A UPC-A barcode is characterized by twelve decimal digits, preceded by a start delimiter and followed by an end delimiter. In the middle of the twelve digit barcode, between the sixth and seventh digits, is a middle delimiter. The start, middle, and end delimiters function to separate the twelve digits into two groups of six digits. The start and end delimiters are characterized by a “101” bit pattern, which may be visualized as two vertical black guard bars with a white space between the bars. The middle delimiter is characterized by a “01010” bit pattern, which may be visualized as a white space, a black vertical guard bar, a white space, a black vertical guard bar, and a white space. Between the start and middle delimiters are six “left” digits, and between the middle and end delimiters are six “right” digits. Each digit is represented by a seven-bit code, with a binary ‘1’ value represented by a vertical black bar and a binary ‘0’ value represented by a vertical white space. The seven-bit code for each digit is represented visually as two bars and two spaces, with each of the bars and spaces having varying width depending on the digit. To distinguish between “left” digits and “right” digits, a “left” digit seven-bit code is the inverse of a “right” digit seven-bit code. The following table illustrates the seven-bit code values for each barcode digit.
DigitLeft PatternRight Pattern000011011110010100110011100110200100111101100301111011000010401000111011100501100011001110601011111010000701110111000100801101111001000900010111110100
Among the twelve digits of the barcode, the first, or leftmost, digit is a prefix digit, while the last, or rightmost digit, is an error correcting check digit.
A commonly used EAN barcode is an EAN-13 barcode. The EAN-13 barcode is a superset of a UPC-A barcode. The EAN-13 barcode uses thirteen digits broken up into four components: a prefix, which may be two or three digits long; a company number, which may be four to six digits long, an item reference number, which may be two to six digits, and a single checksum digit. EAN-13 barcodes differ from UPC-A barcodes in that the data digits are split into three groups: a first digit, a first group of six digits, and a second group of six digits. The first group of six digits is encoded according to one of two encoding schemes, one of which has even parity and one of which has odd parity, while the second group of six digits is encoded as bitwise complements to the digits of the first group having the odd parity encoding scheme.
Barcodes are commonly read using fixed or mounted barcode scanners, such as those found as part of a point-of-sale system, or using commercial laser-based, handheld barcode readers, which are often attached to a point-of-sale system. However, with the proliferation of handheld and mobile devices, there is a growing interest in leveraging the ability of these devices to read barcodes.